import 'package:demo1223/routers/application.dart';
import 'package:flutter/material.dart';
import 'pages/index_page.dart';
import 'package:provide/provide.dart';
import './provide/conter.dart';
import './provide/child_cate.dart';
import 'package:fluro/fluro.dart';
import './routers/router.dart';
import './provide/detailsDats.dart';
import './provide/classification_list.dart';
import './provide/cart_provide.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import './pages/login.dart';
import './provide/gettoken.dart';

void main() {
  
  var conter = Conter();
  var childcate = Childcate();
  var detailsInfoProvide = DetailsInfoProvide();
  var goodslist = Goodslist();
  var providers = Providers();
  var cartProvides = CartProvides();
  var gettoken = Gettoken();

  providers..provide(Provider<Conter>.value(conter));
  providers..provide(Provider<Childcate>.value(childcate));
  providers..provide(Provider<DetailsInfoProvide>.value(detailsInfoProvide));
  providers..provide(Provider<Goodslist>.value(goodslist));
  providers..provide(Provider<CartProvides>.value(cartProvides));
  providers..provide(Provider<Gettoken>.value(gettoken));

  runApp(ProviderNode(child: MyApp(), providers: providers));
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final router = Router();
    Routes.configureRoutes(router);
    Application.router = router;
    return Container(
      child: MaterialApp(
        title: '工流界',
        onGenerateRoute: Application.router.generator,
        debugShowCheckedModeBanner: false,
        theme: ThemeData(primaryColor: Color.fromRGBO(255, 51, 51, 1)),
        home: Loginpage()
        // Loginpage()
        // Indexpage(),
      ),
    );
  }
}
